package com.niiwoo.civet.user.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

import com.niiwoo.civet.user.dto.request.OrgUserLoginReqDTO;
import com.niiwoo.civet.user.dto.request.OrganizationInfoReqDTO;
import com.niiwoo.civet.user.dto.request.OrganizationRequestDTO;
import com.niiwoo.civet.user.dto.request.SimpleOrgInfo;
import com.niiwoo.civet.user.dto.response.OrgInfoRespDTO;
import com.niiwoo.civet.user.dto.response.OrganizationInfoRespDTO;
import com.niiwoo.civet.user.dto.response.organization.OrganizationBaseConfigRespDTO;
import com.niiwoo.civet.user.enums.OrganizationEnum;

/**
 * @Description: 机构相关服务
 * @Author:LiJian
 * @Date:2017/12/15
 */
public interface OrganizationDubboService {

    /**
     * 获取机构信息
     * @param orgId
     * @return
     */
    default SimpleOrgInfo getByOrgId(String orgId) {
        return null;
    }

    /**
     * 根据机构简称获取机构信息
     * @param abbreviation
     * @return
     */
    default SimpleOrgInfo getByAbbreviation(String abbreviation){
        return null;
    }

    /**
     * 获取机构信息
     * @param orgIdSet
     * @return
     */
    default List<SimpleOrgInfo> queryListByOrgIdSet(Set<String> orgIdSet) {
        return null;
    }

    /**
     * 获取对应类型的机构列表
     * @param organizationEnum
     * @return
     */
    SimpleOrgInfo getSimpleOrgInfoByType(OrganizationEnum organizationEnum);

    /**
     * 获取担保和反担保机构信息
     * @return
     */
    List<SimpleOrgInfo> getGuaranteeAndAntiGuaranteeInfo();

    /**
     * 机构开启合作?
     * @param orgCode 机构编码
     * @return
     */
    default boolean isCooperate(String orgCode){return false;}
    /**
     * 修改用户中心企业资料
     * @param orgInfoReqDto
     * @return
     */
	default boolean updateUserOrgInfo(OrganizationRequestDTO orgInfoReqDto){return false;}

    /**
     * 根据机构编码获取机构ID
     *
     * @param orgCode
     * @return
     */
    default String getOrgId(String orgCode) {
	    return null;
    }
    
    /**
     * 查询机构配置信息
     *
     * @param orgId
     * @return
     */
    default OrganizationBaseConfigRespDTO selectOrganizationBaseConfigByOrgId(String orgId) {
        return null;
    }

    /**
     * 是否足额冻结履约金
     * ps：机构为空返回false
     *
     * @param orgId 机构id
     * @return true false
     */
    default boolean isFullFreezePerformance(String orgId) {return false;}

    /**
     * 校验用户二要素认证
     *
     * @param realName
     * @param identityCard
     */
    default Integer checkAgentUserRealName(String realName,String identityCard){return null;}

    default OrgInfoRespDTO queryOrgInfoById(String orgId){return null;}

    /**
     * 根据orgCode获取有效orgId,如果不存在，抛出异常
     *
     * @param orgCode
     * @return
     */
    default String loadValidOrgId(String orgCode){return null;}

    default BigDecimal getMaxOrgRate(){return null;}

    default OrganizationInfoRespDTO selectOrganizationInfoByAgentUserName(String agentUserName) {
        throw new UnsupportedOperationException("selectOrganizationInfoByAgentUserName未实现");
    }

    default boolean sendSmsByLogin(String mobliePhone) {
        throw new UnsupportedOperationException("sendSmsByLogin未实现");
    }

    default int updatePassword(OrganizationInfoReqDTO organizationInfoReqDTO) {
        throw new UnsupportedOperationException("updatePassword未实现");
    }

    default int insertLoginRecord(OrgUserLoginReqDTO orgUserLoginReqDTO) {
        throw new UnsupportedOperationException("updatePassword未实现");
    }

    /**
     * 根据企业统一社会信用代码获取企业信息
     * @param unifiedSocialCreditCode
     * @return
     */
    default SimpleOrgInfo queryOrgBySocialCreditCode(String unifiedSocialCreditCode) {
        throw new UnsupportedOperationException("unimplemented");
    }
}
